<template>
	<view class="editor">
		<rich-text :nodes="content"></rich-text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content:'',
			}
		},
		methods: {
			getContent(e){
				uni.setNavigationBarTitle({
					title:e == 'store_service' ? '用户协议' : e == 'store_privacy' ? '隐私政策' : e == 'logout' ? '注销账号' : ''
				})
				this.request.httpTokenRequest({
					url: "/index/policy",
					method: "get"
				}, {
					type:e
				}).then( data =>{
					if (data.code == 0) {
						this.content = data.data.content
					} else {
						
					}
				})
			}
		},
		
		onLoad(option) {
			this.getContent(option.type)
		}
	}
</script>

<style lang="scss" scoped>
	.editor {
		padding: 30rpx;
	}
</style>
